package org.yccheok.blobsallad;

import java.awt.Graphics;

import javax.swing.BorderFactory;
import javax.swing.GroupLayout;
import javax.swing.JPanel;

/**
 */
public class View extends JPanel {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private final Controller controller;

	/** Creates new form View */
	public View(Controller controller) {
		this.controller = controller;
		initComponents();
	}

	/**
	 * This method is called from within the constructor to initialize the form.
	 * WARNING: Do NOT modify this code. The content of this method is always
	 * regenerated by the Form Editor.
	 */
	private void initComponents() {

		setBorder(BorderFactory.createLineBorder(new java.awt.Color(0, 0, 0)));

		GroupLayout layout = new GroupLayout(this);
		this.setLayout(layout);
		layout.setHorizontalGroup(layout.createParallelGroup(
				GroupLayout.Alignment.LEADING).addGap(0, 398, Short.MAX_VALUE));
		layout.setVerticalGroup(layout.createParallelGroup(
				GroupLayout.Alignment.LEADING).addGap(0, 298, Short.MAX_VALUE));
	}

	@Override
	public void paintComponent(Graphics graphics) {
		super.paintComponent(graphics);
		this.controller.paintComponent(graphics);
	}
}
